{if $webdb.weixin_type==3&&$userdb.weixin_api!=''}
<script type="text/javascript">
var is_inwxapp=false;
$(function(){
	wx.miniProgram.getEnv(function(res) {
		if(res.miniprogram==true){
			is_inwxapp=true;
		}
	});

	if($.cookie('mp_gz_remind')!='NO'&&"{$userdb['uid']}"!=''){
	$.get("{:purl('weixin/check/ifgz',[],'index')}",function(res){
		if(res.code==1){
			setTimeout(function(){
				if(is_inwxapp){
					layer.confirm("关注公众号，可享受更多权限！",{offset: 'rb',title:false,close:false,shade: 0 ,btn:['关注','别烦我']},function(){
						wx.miniProgram.navigateTo( { url: "/pages/gzmp/index?url={:urlencode(get_url('location'))}&mpurl={:urlencode($webdb.weixin_mpurl)}" } );
					},function(){
						$.cookie('mp_gz_remind', 'NO', { expires: 24*60*7, path: '/' });   //提醒频率,单位分钟
					});
				}else{
					layer.open({
						type: 1
						,offset: 'rb'
						,anim:2
						,title:'欢迎关注公众号'
						,area:['190px','190px']
						,content: '<div style="padding: 0px;text-align:center;"><span style="font-size:12px;">关注后,可以享受更多权益!</span><img src="{$webdb.mp_code_img|tempdir}" style="width:120px;height:120px;"></div>'        
						,shade: 0 //不显示遮罩 
						,cancel: function(index, layero){
							$.cookie('mp_gz_remind', 'NO', { expires: 24*60*7, path: '/' });   //提醒频率,单位分钟
						}
					});
				}
			},5000);
		}
	});
	}
});
</script>
{/if}